@echo off
title Aion-Finish AI2 BuildAll Console



CLS
:MENU
ECHO.
ECHO.
ECHO.
ECHO                                  ''~``
ECHO                                 ( o o )
ECHO    ------------------------.oooO--(_)--Oooo.------------------------
ECHO    .             1 - Build All                                     .
ECHO    .             2 - Build GameServer server                       .
ECHO    .             3 - Build LoginServer server                      .
ECHO    .             4 - Build ChatServer server                       .
ECHO    .             5 - Build Commons                                 .
ECHO    .             6 - Build PacketSamurai                           .
ECHO    .             7 - Quit                                          .
ECHO    .                         .oooO                                 .
ECHO    .                         (   )   Oooo.                         .
ECHO    ---------------------------\ (----(   )--------------------------
ECHO                                \_)    ) /
ECHO                                      (_/
ECHO.
ECHO.
SET /P Ares=Type 1, 2 ,3, 4, 5, 6 or 7 to QUIT, then press ENTER:

IF %Ares%==1 GOTO FULL
IF %Ares%==2 GOTO GameServer
IF %Ares%==3 GOTO LoginServer
IF %Ares%==4 GOTO ChatServer
IF %Ares%==5 GOTO Commons
IF %Ares%==6 GOTO PacketSamurai
IF %Ares%==7 GOTO QUIT

:FULL
@echo off
if exist build rd build /s /q
mkdir build
cls
cd servers\GameServer
start /WAIT /B ..\..\Tools\Ant\bin\ant clean dist

cd ..\LoginServer
start /WAIT /B ..\..\Tools\Ant\bin\ant clean dist

cd ..\ChatServer
start /WAIT /B ..\..\Tools\Ant\bin\ant clean dist

cd ..\commons
start /WAIT /B ..\..\Tools\Ant\bin\ant clean dist

cd ..\PacketSamurai
start /WAIT /B ..\..\Tools\Ant\bin\ant clean dist

GOTO :QUIT

:GameServer
if not exist build\ mkdir build\
if exist build\AJ-Game.zip del build\AJ-Game.zip
cd servers\GameServer
start /WAIT /B ..\..\Tools\Ant\bin\ant clean dist
GOTO :QUIT

:LoginServer
if not exist build\ mkdir build\
if exist build\AJ-Login.zip del build\AJ-Login.zip
cd servers\LoginServer
start /WAIT /B ..\..\Tools\Ant\bin\ant clean dist
GOTO :QUIT

:ChatServer
if not exist build\ mkdir build\
if exist build\AJ-Chat.zip del build\AJ-Chat.zip
cd servers\ChatServer
start /WAIT /B ..\..\Tools\Ant\bin\ant clean dist
GOTO :QUIT

:Commons
if not exist build\ mkdir build\
if exist build\AJ-Commons.zip del build\AJ-commons.zip
cd servers\commons
start /WAIT /B ..\..\Tools\Ant\bin\ant clean dist
GOTO :QUIT

:PacketSamurai
if not exist build\ mkdir build\
if exist build\AJ-packetsamurai.zip del build\AJ-packetsamurai.zip
cd servers\PacketSamurai
start /WAIT /B ..\..\Tools\Ant\bin\ant clean dist
cd ../../
GOTO :QUIT

:QUIT
exit
